# num = int(input("输入一个三位数："))
# cer = num
# a = num % 10
# num = num // 10
# b = num % 10
# num = num // 10
# c = num % 10
# sum = pow(a,3)+pow(b,3)+pow(c,3)
# if sum == cer:
#     print(1,end=' ')
# else:
#     print(0,end=' ')

# num = int(input())
# t = 0
# sum = 0
# while num > 0:
#     t = num % 10
#     sum = sum * 10 + t
#     num = num // 10
# print(sum,end = ' ')


# str = str(input("输入一个字符串："))
# count = 0
# for ch in str:
#     if ch == 'a'or ch == 'A':
#         count+=1
# print(count,end=' ')



# str = str(input("输入一个字符串："))
# for i in range(len(str)-1 , -1 ,-1):
#     print(str[i],end = ' ')

num = int(input())
cer = num
a = num % 10
num = num//10
b = num % 10
num = num // 10
c = num % 10
sum = pow(a,3)+pow(b,3)+pow(c,3)
if sum == cer:
  print(1,end = ' ')
else:
  print(0,end = ' ')